package com.qianfeng.smartdevice.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import sun.security.krb5.internal.PAData;

import java.util.Date;
@ApiModel(description = "温湿度数据对象")
public class Humiture implements CheckEmptyInterface{
  @ApiModelProperty(value = "主键",hidden = true)
  private Long id;
  @ApiModelProperty(value = "设备uuid",required = true,example = "HT1234567890")
  private String deviceUUID;
  @ApiModelProperty(value = "湿度百分比",required = true,example = "20")
  private Double humidity;
  @ApiModelProperty(value = "温度",required = true,example = "36.9")
  private Double temperature;

  @ApiModelProperty(value = "上传时间",example = "2021-06-03 13:00:00")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private Date uploaddate;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getDeviceUUID() {
    return deviceUUID;
  }

  public void setDeviceUUID(String deviceUUID) {
    this.deviceUUID = deviceUUID;
  }

  public Double getHumidity() {
    return humidity;
  }

  public void setHumidity(Double humidity) {
    this.humidity = humidity;
  }

  public Double getTemperature() {
    return temperature;
  }

  public void setTemperature(Double temperature) {
    this.temperature = temperature;
  }

  public Date getUploaddate() {
    return uploaddate;
  }

  public void setUploaddate(Date uploaddate) {
    this.uploaddate = uploaddate;
  }

  @Override
  public boolean isEmpty() {
    return temperature == null || humidity == null || temperature == 0 || humidity == 0;
  }

  @Override
  public String toString() {
    return "Humiture{" +
            "id=" + id +
            ", deviceUUID=" + deviceUUID +
            ", humidity=" + humidity +
            ", temperature=" + temperature +
            ", uploaddate=" + uploaddate +
            '}';
  }
}
